<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Zaposleni</title>
        <h:outputStylesheet library="css" name="styles.css"/> 
    </h:head>
    <h:body>
        <ui:include src="menuBar.xhtml"/>
        <h:form>
            <p:panel header="Zaposleni" styleClass="headerPanel"> 
                <div class="employeeFrag">
                    <p:dataTable value="#{employeeBean.employeeList}" var="e">
                        <p:column filterBy="ime" filterMatchMode="contains" filterStyle="margin: auto; margin-left: 2%; width: 125px;" >
                            <p:fieldset style="background: #eeeeee; border: 1px solid #d8dcdf" legend="#{e.ime} #{e.prezime}" toggleable="true" toggleSpeed="500" collapsed="true" >  
                                <p:tabView>
                                    <p:tab title="O profesoru">
                                        <p:panelGrid columns="2">
                                            <p:graphicImage value="#{employeeBean.getImage(e.slika)}" alt="Slika"/>
                                            <p:panelGrid columns="2">    

                                                <h:outputLabel value="Kabinet: "/>
                                                <h:outputLabel value="#{e.kabinet}"/>

                                                <h:outputLabel value="Prijem: "/>
                                                <h:outputLabel value="#{e.prijem}"/>

                                                <h:outputLabel value="Zvanje: "/>
                                                <h:outputLabel value="#{e.zvanje}"/>

                                                <h:outputLabel value="Status: "/>
                                                <h:outputLabel value="#{e.status}"/>

                                                <h:outputLabel value="Telefon: "/>
                                                <h:outputLabel value="#{e.telefon}"/>

                                                <h:outputLabel value="Web: "/>
                                                <h:outputLabel value="#{e.web}"/>

                                                <h:outputLabel value="Adresa: "/>
                                                <h:outputLabel value="#{e.adresa}"/>

                                                <h:outputLabel value="E-mail: "/>
                                                <h:outputLabel value="#{e.mail}"/>

                                            </p:panelGrid>
                                        </p:panelGrid>
                                    </p:tab>
                                    <p:tab title="CV">
                                        <h:outputLabel value="#{e.cv}" />
                                    </p:tab>
                                    <p:tab title="Predaje">
                                        <div class="datatable">
                                            <p:dataTable var="predmet" value="#{employeeBean.toList(e)}" 
                                                         paginator="true" rows="10"  
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                                         rowsPerPageTemplate="5,10,15">
                                                <p:column headerText="Sifra" filterBy="sifra" filterMatchMode="contains">
                                                    <h:outputText value="#{predmet.sifra}"/>
                                                </p:column>
                                                <p:column headerText="">
                                                    <p:commandButton value="Detalji" action="#{courseBean.getPredmetById(predmet.idPredmet)}" ajax="false"/>
                                                </p:column>
                                            </p:dataTable>
                                        </div>
                                    </p:tab>
                                </p:tabView>
                            </p:fieldset>
                        </p:column>
                    </p:dataTable>
                </div>
            </p:panel>
        </h:form>
    </h:body>
</html>

